package com.auto.sns.core.dao.impl;

import java.util.List;
import java.util.Map;

import com.system.common.Page;
import com.auto.sns.core.domain.SnsCoreActivity;
import com.auto.sns.core.dao.ISnsCoreActivityDAO;
import com.system.util.PersistUtil;
import com.auto.sns.core.sql.sqlid.SnsCoreActivitySqlID;
/**
 * : t_auto_sns_core_activity
 * 
 * 
 * @author Gen
 */
public class SnsCoreActivityDAOImpl implements ISnsCoreActivityDAO{

	public SnsCoreActivity insertSnsCoreActivity(SnsCoreActivity bean){
		return PersistUtil.insert(bean, SnsCoreActivitySqlID.INSERT);
	}

	public boolean deleteSnsCoreActivity(String scacGuid){
		PersistUtil.delete(scacGuid, SnsCoreActivitySqlID.DELETE);
		return true;
	}	

	public SnsCoreActivity updateSnsCoreActivity(SnsCoreActivity bean){
		return PersistUtil.update(bean, SnsCoreActivitySqlID.UPDATE);
	}	

	public SnsCoreActivity loadSnsCoreActivity(String scacGuid){
		return PersistUtil.query(new SnsCoreActivity().getClass(), scacGuid);
	}

	public List<SnsCoreActivity> queryList(Map<String,Object> param,Page page){
		page.setCount(PersistUtil.countSpecial(param, SnsCoreActivitySqlID.QUERY));
		return PersistUtil.querySpecial(param, SnsCoreActivitySqlID.QUERY, page.getFullOrderBy(), page.getOffset(), page.getLimit());
	}

	public boolean updateReplyNum(String scacGuid) {
		PersistUtil.update(scacGuid, SnsCoreActivitySqlID.UPDATE_REPLY_NUM);
		return true;
	}

	public boolean updateRecommendNum(String scacGuid) {
		PersistUtil.update(scacGuid, SnsCoreActivitySqlID.UPDATE_RECOMMEND_NUM);
		return true;
	}

	public boolean updateFavoriteNum(String scacGuid) {
		PersistUtil.update(scacGuid, SnsCoreActivitySqlID.UPDATE_FAVORITE_NUM);
		return true;
	}

}
